// pages/base/version/version.ts
Page({

  /**
   * 页面的初始数据
   */
  data: {
    baseImgUrl: getApp().globalData.IMG_URL,
    versionInfo: {}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    this.getVerisonInfo()
  },
  /**
   * 获取版本信息
   */
  getVerisonInfo(): void {
    var that = this
    // const token = wx.getStorageSync('token')
    const preUrl = getApp().globalData.SERVER_URL

    const goodsPageForHomeUrl = preUrl + "sys/appVersion/queryLatest"
    wx.request({
      url: goodsPageForHomeUrl,
      method: 'GET',
      data: {
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded', // 默认值
        // 'X-Access-Token': token
      },
      success(res: any) {
        // console.info(JSON.stringify(res))
        if (res.data.code == 200) {
          that.setData({ versionInfo: res.data.result })
          console.info(JSON.stringify(that.data.versionInfo))
        } else {
          console.info(JSON.stringify(res))
        }
      },
    })
  }
})